<%--
  Created by IntelliJ IDEA.
  User: jerry
  Date: 12/6/2024
  Time: 15:26
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page import="java.util.*" %>
<%@ page import="org.goldfish.cookied_chatroom02.entity.DetailBean" %>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>消息详情</title>
</head>
<body>
<form method="get" action="chat">
    <table>
        <tr>
            <td>标题</td>
            <td>${requestScope.title}</td>
        </tr>
        <tr>
            <td>发送方</td>
            <td>${requestScope.sender}</td>
        </tr>
    </table>
    <c:forEach var="line" items="${requestScope.details_to_display}"
               varStatus="lineNumber">
        <label>${line.line_number}:${line.content}</label>
        <br/>
    </c:forEach>
    <button type="submit" name="return" value="true">返回</button>
</form>

</body>
<script type="application/javascript">
<c:set var="message">
    <c:set var="message">
        ${requestScope.get("error_message")}
    </c:set>
    <c:choose>
        <c:when test="${message == null}"/>
        <c:when test="${message == \"\"}"/>
        <c:otherwise>
            alert("${message}")
        </c:otherwise>
    </c:choose>
    </script>
</html>
